package com.jt.mapper;

import com.jt.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface UserMapper {
    //查询所有的user表数据
    List<User> findAll();

    @Select("select * from demo_user where id=#{id}")
    User findUserById(int id);

    @Insert("insert into demo_user values(null,#{name},#{age},#{sex})")
    void insert(User user);

    @Delete("delete from demo_user where id=#{id}")
    void delete(int id);

    @Update("update demo_user set name=#{name},age=#{age},sex=#{sex} where id=#{id}")
    void update(User user);
}